package com.hongchen.wechat.service;

import com.hongchen.model.MeetUser;
import com.realdtech.base.ServiceSupport;

import java.util.List;

/**
 * Created by 录康哲 on 2018/2/6.
 */
public class ActivityService extends ServiceSupport<MeetUser> {
    private final MeetUser dao = new MeetUser().dao();

    /**
     * 查询所有参与用户
     * @return
     */
    public List<MeetUser> list_user(){
        return dao.find("SELECT * FROM "+ MeetUser.TABLE_NAME);
    }

    /**
     * 根据openid查询用户信息
     * @param openid
     * @return
     */
   public MeetUser openid(String openid){
        return dao.findFirst("select id,openid,nickname,sex,time,headimgurl from " + MeetUser.TABLE_NAME + " where openid=?", openid);
   }



    @Override
    public void clearCache() {

    }

    @Override
    public void removeCache(Object... id) {

    }

    @Override
    public MeetUser get(Object... id) {
        return null;
    }
}
